import requests
from haishen_app.news.constant.login_http_api import LoginHttpApi
from haishen_biz.news.fixed_data.news_biz_test_data import NewsBizTestData

class LoginHttpCaller:
    def __init__(self):
        self.base_url = "api.webxd.top"
        self.headers = {}
        self.json_data = NewsBizTestData.get_file_data("json_data.json")
    def user_login(self,data_name:str):
        return requests.post(url=self.base_url + LoginHttpApi.LOGIN,
                             headers=self.headers,
                             json=self.json_data[data_name])